#ifndef CONFIGURATIONDIALOG_H
#define CONFIGURATIONDIALOG_H

#include <QDialog>
#include "settings/settings.h"
#include "db/dbconnection.h"
#include <QMovie>
#include <QPaintEvent>

namespace Ui {
    class ConfigurationDialog;
}

class ConfigurationDialog : public QDialog
{
    Q_OBJECT

public:
    virtual void paintEvent(QPaintEvent *event);
private:
    QMovie _loadAnimation;
    bool _isLoad;
private slots:
    void paintNewFrame(int);

private:
    void _fillInputsBySettings();
    bool _testConnection();

public:
    explicit ConfigurationDialog(QWidget *parent = 0);
    ~ConfigurationDialog();
    Ui::ConfigurationDialog *ui;

    void setSettings(QSharedPointer <Settings> __settings);
    void setDbConnection(QSharedPointer <DbConnection> __dbConnect);


    QSharedPointer <DbConnection> dbConnect;
    QSharedPointer <Settings> settings;

    void done(int r);

public slots:
    void onTest();
};

#endif // CONFIGURATIONDIALOG_H
